package com.logistics.delivery.entity.model;

import com.logistics.delivery.entity.domain.DeliveryContainer;
import lombok.Data;

@Data
public class DeliveryContainerRow {

    private Integer id;

    /**
     * 配送单
     */
    private String delivery;

    /**
     * 拣配单
     */
    private String pick;

    /**
     * 托盘
     */
    private String container;

    /**
     * 托盘层级
     */
    private Integer containerLevel;

    /**
     * 是否是空托盘（0:非空，1:空托）
     */
    private Boolean isEmpty;

    private String station;

    public DeliveryContainerRow(){}

    public DeliveryContainerRow(DeliveryContainer deliveryContainer){
        this.id = deliveryContainer.getId();
        this.delivery = deliveryContainer.getDelivery();
        this.pick = deliveryContainer.getPick();
        this.container = deliveryContainer.getContainer();
        this.station = deliveryContainer.getStation();
        this.containerLevel = deliveryContainer.getContainerLevel();
        this.isEmpty = deliveryContainer.getIsEmpty();
    }

    public static DeliveryContainerRow build(DeliveryContainer deliveryContainer){
        return new DeliveryContainerRow(deliveryContainer);
    }
}
